package com.deng.framework.core.convert;

import org.springframework.lang.Nullable;

/**
 * 类型转换抽象接口,convert就是专门处理类型转换的部分
 *
 * ps:类型转换这部分由于文章写的不是很详细，我没有认真看
 */
public interface ConversionService {

    /** Return {@code true} if objects of {@code sourceType} can be converted to the {@code targetType}. */
    boolean canConvert(@Nullable Class<?> sourceType, Class<?> targetType);

    /** Convert the given {@code source} to the specified {@code targetType}. */
    <T> T convert(Object source, Class<T> targetType);

}
